package com.quickcancellation.crm.utils;

import org.springframework.util.StringUtils;

import java.util.regex.Pattern;

/**
 * 校验工具类
 */
public class CheckUtils {
    /**
     * 校验所有字符串是否都为不为空
     * @param params 字符串
     * @return 是否都不为空
     */
    public static boolean isAllEmpty(String... params) {

        for (String param : params) {
            String checkParam = param.trim();
            if (!StringUtils.hasLength(checkParam)) {
                return false;
            }
        }
        return true;

    }

    public static boolean checkPhone(String phone){

        return Pattern.matches("^1[3,4,5,6,7,8,9]\\d{9}$", phone);

    }


}
